package com.scs.application.modules.upms.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.scs.application.core.model.CommonResult;
import com.scs.application.core.utils.StringUtils;
import com.scs.application.core.mvc.controller.BaseController;
import com.scs.application.modules.upms.entity.GenTableColumn;
import com.scs.application.modules.upms.request.GenTableColumnListRequest;
import com.scs.application.modules.upms.service.GenTableColumnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description:
 */
@RestController
@RequestMapping("/upms/gen_table_columns")
public class GenTableColumnController extends BaseController {

    @Autowired
    private GenTableColumnService genTableColumnService;


    @GetMapping("/list")
    public CommonResult list(GenTableColumnListRequest request) {
        List<GenTableColumn> list = genTableColumnService.list(new QueryWrapper<GenTableColumn>()
                .eq(StringUtils.isNotBlank(request.getTableId()), "table_id", request.getTableId()));
        return CommonResult.ok("查询成功", list);
    }

}
